Tangent-Linear Models by Augmented LL-Parsers

نویسندگان

  • Uwe Naumann
  • Andre Vehreschild
چکیده

We describe a novel method for the generation of tangent-linear code by augmentation of LL-parsers generated by the software tool ANTLR. The main advantage of this approach to source code augmentation is the missing requirement for an internal representation of the original program. We consider this work as the basis for further investigations into how far this technique can be extended in the context of more sophisticated transformations, for example, the automatic generation of adjoint codes. Our prototype tool AD C ANTLR currently accepts a subset of the ANSI C standard. We discuss its theoretical basis, and we present case studies to underline the elegance of the parser-based approach to source augmentation. 1 Motivation and Summary of Results What are tangent-linear models good for? Consider the elliptic partial differential equation −∆y − λe = 0 (1) on the unit square Ω where y(x1, x2) = 0 on ∂Ω. 1 The Laplacian operator is defined as ∆ ≡ ∂ ∂x 1 + ∂ ∂x 2 . It can be solved using a centered finite difference scheme by approximating the first derivative with respect to x1 and x2 at the midpoints of the discretization intervals a = ( x1i − x 1 i−1 2 , x2j ), b = ( x1i+1 − x 1 i

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Linear Time Parsers for Classes of Non Context Free Languages

Deterministic parsers have been proposed for two-level control grammars. These parsers are efficient in both time and space and are simple extensions of the standard LL(I) and LR( 1) parsers for deterministic context free languages. An important advantage of the parsers proposed here is that existing parser generator tools can be augmented to generate them from grammar specifications. Since the...

متن کامل

Controlled Grammatic

A new approach to ambiguity of context-free grammars is presented, and within this approach the LL and LR techniques are generalized to solve the following problems for large classes of ambiguous grammars: |Construction of a parser that accepts all sentences generated by the grammar, and which always terminates in linear time. |Identiication of the structural ambiguity: a nite set of pairs of p...

متن کامل

Taurus, a Parser Generator Producing Error Recovering Parsers in Scheme

A parser generator producing recursive descent LL(1) parsers was implemented. The generated parsers include automatic syntactic error recovery and error reporting. The i mplementation language for both the parser generator and the generated parsers is Scheme.

متن کامل

Modeling Operating Systems Schedulers with Multi-Stack-Queue Grammars

This original method for specifying and checking the sequences of events taking place in process scheduling brings the classical syntax-directed approach of compilation to this new area. The formal language of scheduling events cannot be speciied by BNF grammars, but we use instead the Augmented BNF grammars, which combine breadth{ rst and depth-rst derivations. Their recognizers feature one or...

متن کامل

Practical Packrat Parsing

A considerable number of research projects are exploring how to extend object-oriented programming languages such as Java with, for example, support for generics, multiple dispatch, or pattern matching. To keep up with these changes, language implementors need appropriate tools. In this context, easily extensible parser generators are especially important because parsing program sources is a ne...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2006